#! /bin/bash

mkdir -p /var/log/mlsql

echo "解压 mlsql"
tar -zxvf /tmp/mlsql-engine.tar.gz  -C /opt >> /var/log/mlsql/mlsql-install.log
tar -zxvf /tmp/mlsql-console.tar.gz  -C /opt >> /var/log/mlsql/mlsql-install.log
tar -zxvf /tmp/mlsql-cluster.tar.gz  -C /opt >> /var/log/mlsql/mlsql-install.log
echo "解压完成"

sleep 10
echo "软连接mlsql"
ln -s /opt/mlsql-engine* /opt/mlsql-engine
ln -s /opt/mlsql-console* /opt/mlsql-console
ln -s /opt/mlsql-cluster* /opt/mlsql-cluster
echo "软连接完成"


#echo `nohup sh /opt/mlsql-engine/start-default.sh 2>&1>> /var/log/mlsql/mlsql-engine.log`

#ps aux|grep 'mlsql-engine' | grep -v grep | awk '{print $2}' > /var/run/mlsql-engine.pid
